package com.demo.entity.base;

public class Page {

	public int pageSize = 20;
	public int beginNo = 0;
	public int currentPage = 1;

	public Page(int currentPage) {
		init(pageSize, currentPage);
	}

	public Page(int pageSize, int currentPage) {
		init(pageSize, currentPage);
	}

	private void init(int pageSize, int currentPage) {
		if (currentPage <= 0)
			currentPage = 1;
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.beginNo = (currentPage - 1) * pageSize;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getBeginNo() {
		return beginNo;
	}

	public void setBeginNo(int beginNo) {
		this.beginNo = beginNo;
	}

}
